import { createOpenAI } from '@ai-sdk/openai';

/**
 * Custom OpenAI provider configuration
 * Supports using alternative API endpoints like apiyi.com for Claude
 */
export const customOpenAI = createOpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: process.env.OPENAI_BASE_URL || 'https://api.apiyi.com/v1',
  compatibility: 'compatible', // for non-OpenAI providers
});

// Export the configured provider
export const openai = customOpenAI;